import React from 'react';
import type { AccountInfo } from '../types/wechat';

const AccountSelectorModal: React.FC<{
  accounts: AccountInfo[];
  currentId: string;
  onSelect: (id: string) => void;
  onClose: () => void;
}> = ({ accounts, currentId, onSelect, onClose }) => (
  <div className="modal">
    <div className="modal-content">
      <h2>选择你要切换的账号</h2>
      {accounts.map(acc => (
        <div
          key={acc.id}
          className={`account-item ${acc.id === currentId ? 'active' : ''}`}
          onClick={() => onSelect(acc.id)}
        >
          <div>{acc.nickname}</div>
          <div>{acc.wechatId}</div>
          {acc.id === currentId && <span>当前账号</span>}
        </div>
      ))}
      <button onClick={onClose}>关闭</button>
    </div>
  </div>
);

export default AccountSelectorModal; 